package org.janusproject.demos.acl.cnp;

import java.util.logging.Level;

import org.janusproject.demos.acl.cnp.agent.ACLCallForProposalReceiver;
import org.janusproject.demos.acl.cnp.agent.ACLCallForProposalSender;
import org.janusproject.kernel.agent.Kernel;
import org.janusproject.kernel.agent.Kernels;
import org.janusproject.kernel.logger.LoggerUtil;

/**
 * DEMO : Contract Net Protocol
 */
public class Launcher {
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		
		LoggerUtil.setGlobalLevel(Level.ALL);
		LoggerUtil.setShortLogMessageEnable(true);
		
		Kernel k = Kernels.get( false );
		
		ACLCallForProposalSender sender = new ACLCallForProposalSender();
		ACLCallForProposalReceiver receiver1 = new ACLCallForProposalReceiver();
		ACLCallForProposalReceiver receiver2 = new ACLCallForProposalReceiver();
		
		k.submitLightAgent(sender, "sender");
		k.submitLightAgent(receiver1, "receiver1");
		k.submitLightAgent(receiver2, "receiver2");
		
		k.launchDifferedExecutionAgents();	
		
		Kernels.killAll();
	}	
}
